package com.example.framework.mqtt.core.annotation;

import net.dreamlu.iot.mqtt.codec.MqttQoS;
import org.springframework.stereotype.Component;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Mqtt监听器注解
 */
@Target(value = {ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Component
public @interface MqttMessageListener {

    /**
     * 主题
     */
    String[] topics();

    /**
     * 消息质量
     */
    MqttQoS qos() default MqttQoS.QOS0;
}
